home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing;
-
- import com.sun.java.swing.plaf.IconUIResource;
- import java.io.BufferedInputStream;
- import java.io.ByteArrayOutputStream;
- import java.io.FilterInputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
-
- class LookAndFeel$1 implements UIDefaults.LazyValue {
- // $FF: synthetic field
- Class val$baseClass;
- // $FF: synthetic field
- String val$gifFile;
-
- public Object createValue(UIDefaults table) {
- byte[] buffer = null;
-
- try {
- InputStream resource = this.val$baseClass.getResourceAsStream(this.val$gifFile);
- if (resource == null) {
- System.err.println(this.val$baseClass.getName() + "/" + this.val$gifFile + " not found.");
- return null;
- }
-
- BufferedInputStream in = new BufferedInputStream(resource);
- ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
- buffer = new byte[1024];
-
- int n;
- while((n = ((FilterInputStream)in).read(buffer)) > 0) {
- out.write(buffer, 0, n);
- }
-
- ((FilterInputStream)in).close();
- ((OutputStream)out).flush();
- buffer = out.toByteArray();
- if (buffer.length == 0) {
- System.err.println("warning: " + this.val$gifFile + " is zero-length");
- return null;
- }
- } catch (IOException var7) {
- System.err.println(((Throwable)var7).toString());
- return null;
- }
-
- return new IconUIResource(new ImageIcon(buffer));
- }
-
- // $FF: synthetic method
- LookAndFeel$1(Class val$baseClass, String val$gifFile) {
- this.val$baseClass = val$baseClass;
- this.val$gifFile = val$gifFile;
- }
- }
-